#ifndef esda_Stream_h
#define esda_Stream_h

/*
 * Copyright (C) Olivier Le Floch
 *
 * See the file LICENSE for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 */

#include "common.h"
#include "Timestamp.h"

namespace esda
{
	template<typename Value>
	class Stream {
	
	public:
		virtual ~Stream();

		virtual Value get(const Timestamp t) const;

		virtual Timestamp getNextStart(const Timestamp t) const;
		virtual Timestamp getNextEnd(const Timestamp t) const;
		virtual Timestamp getPreviousStart(const Timestamp t) const;
		virtual Timestamp getPreviousEnd(const Timestamp t) const;

		virtual Timestamp getFirstStart() const;
		virtual Timestamp getLastEnd() const;
	};
	
	template<typename Value>
	class DataStream : public Stream<Value> {
	
	public:
		virtual void set(const Timestamp& startAndEndTime, const Value v);
		virtual void set(const Timestamp& startTime, const Timestamp& endTime, const Value v);
	};
	
	template<typename Value>
	class OperatorStream : public Stream<Value> {
	
	public:
	};
	
	template<typename Value>
	Stream<Value>::~Stream() {}
	
	template<typename Value>
	Value Stream<Value>::get(const Timestamp t) const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getNextStart(const Timestamp t) const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getNextEnd(const Timestamp t) const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getPreviousStart(const Timestamp t) const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getPreviousEnd(const Timestamp t) const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getFirstStart() const {
		return NULL;
	}
	
	template<typename Value>
	Timestamp Stream<Value>::getLastEnd() const {
		return NULL;
	}
	
	template<typename Value>
	void DataStream<Value>::set(const Timestamp& startAndEndTime, const Value v) {}
	
	template<typename Value>
	void DataStream<Value>::set(const Timestamp& startTime, const Timestamp& endTime, const Value v) {}
}

#endif
